package com.smart.upload.service.impl;

import java.io.File;

import org.springframework.stereotype.Component;

import com.smart.mvc.model.Result;
import com.smart.upload.service.ValidateService;
import com.smart.util.StringUtils;

/**
 * <b>Description:文件类型验证器，只验证系统允许上传的文件类型</b><br>
 * @author 唐海洋
 * @version 1.0 2016-8-5 上午10:49:55
 */
@Component("fileTypeValidateService")
public class FileTypeValidateServiceImpl implements ValidateService{

	@Override
	public final Result validate(File file, String fileName) {
		
		if(file==null || StringUtils.isBlank(fileName)){
			return Result.createErrorResult().setMessage("文件不能为空");
		}
		
		return Result.createSuccessResult();
	}
}
